package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppUserOrderMapper;
import com.ruoyi.system.domain.AppUserOrder;
import com.ruoyi.system.service.IAppUserOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单管理Service业务层处理
 * 
 * @author xuk
 * @date 2024-08-21
 */
@Service
public class AppUserOrderServiceImpl implements IAppUserOrderService 
{
    @Autowired
    private AppUserOrderMapper appUserOrderMapper;

    /**
     * 查询订单管理
     * 
     * @param userId 订单管理主键
     * @return 订单管理
     */
    @Override
    public AppUserOrder selectAppUserOrderByUserId(Long userId)
    {
        return appUserOrderMapper.selectAppUserOrderByUserId(userId);
    }

    /**
     * 查询订单管理列表
     * 
     * @param appUserOrder 订单管理
     * @return 订单管理
     */
    @Override
    public List<AppUserOrder> selectAppUserOrderList(AppUserOrder appUserOrder)
    {
        return appUserOrderMapper.selectAppUserOrderList(appUserOrder);
    }

    /**
     * 新增订单管理
     * 
     * @param appUserOrder 订单管理
     * @return 结果
     */
    @Override
    public int insertAppUserOrder(AppUserOrder appUserOrder)
    {
        appUserOrder.setCreateTime(DateUtils.getNowDate());
        return appUserOrderMapper.insertAppUserOrder(appUserOrder);
    }

    /**
     * 修改订单管理
     * 
     * @param appUserOrder 订单管理
     * @return 结果
     */
    @Override
    public int updateAppUserOrder(AppUserOrder appUserOrder)
    {
        appUserOrder.setUpdateTime(DateUtils.getNowDate());
        return appUserOrderMapper.updateAppUserOrder(appUserOrder);
    }

    /**
     * 批量删除订单管理
     * 
     * @param userIds 需要删除的订单管理主键
     * @return 结果
     */
    @Override
    public int deleteAppUserOrderByUserIds(String userIds)
    {
        return appUserOrderMapper.deleteAppUserOrderByUserIds(Convert.toStrArray(userIds));
    }

    /**
     * 删除订单管理信息
     * 
     * @param userId 订单管理主键
     * @return 结果
     */
    @Override
    public int deleteAppUserOrderByUserId(Long userId)
    {
        return appUserOrderMapper.deleteAppUserOrderByUserId(userId);
    }
}
